//
//  StockBrankTableViewCell.m
//  quxiangtao
//
//  Created by xbmios on 2018/7/6.
//  Copyright © 2018年 shanhaijin. All rights reserved.
//

#import "StockBrankTableViewCell.h"
#import "MarkLabel.h"

@interface StockBrankTableViewCell ()

@property (strong, nonatomic) MarkLabel *numL;
@property (strong, nonatomic) UILabel *nameL;
@property (strong, nonatomic) UILabel *desL;


@end

@implementation StockBrankTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
    
        [self.contentView addSubview:self.numL];
        [self.contentView addSubview:self.nameL];
        [self.contentView addSubview:self.desL];
        
    }
    
    return self;
    
}

- (void)layoutSubviews {
    
    [super layoutSubviews];
    
    __weak typeof(self) weakSelf = self;
    [self.numL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.contentView.mas_left).with.offset(Margin);
        make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY);
        make.width.mas_equalTo(jisuan(40));
        make.height.mas_equalTo(jisuan(40));
    
    }];
    
    [self.nameL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.mas_equalTo(weakSelf.numL.mas_right).with.offset(jisuan(50));
        make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY);
    }];
    
    [self.desL mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.centerY.mas_equalTo(weakSelf.contentView.mas_centerY);
        make.right.mas_equalTo(weakSelf.contentView.mas_right).with.offset(-Margin);
    }];
    
}

#pragma mark -lazy
- (MarkLabel *)numL {
    
    if (!_numL) {
        
        _numL = [[MarkLabel alloc] init];
        _numL.textAlignment = NSTextAlignmentCenter;
        _numL.textColor = WhiteColor;
        _numL.backgroundColor = Color1f89ff;
        _numL.text = @"1";
        _numL.font = Font(24);
        _numL.layer.cornerRadius = jisuan(20);
        _numL.layer.masksToBounds = YES;
        
    }
    
    return _numL;
}

- (UILabel *)nameL {
    
    if (!_nameL) {
    
        _nameL = [[UILabel alloc] init];
        _nameL.text = @"136****8866";
        _nameL.textColor = Color999999;
        _nameL.textAlignment = NSTextAlignmentLeft;
        _nameL.font = Font(24);
    }
    
    return _nameL;
    
}
- (UILabel *)desL {
    
    if (!_desL) {
        
        _desL = [[UILabel alloc] init];
        _desL.text = @"进货投资总金额10000元";
        _desL.textAlignment = NSTextAlignmentLeft;
        _desL.font = Font(24);
        _desL.textColor = Color999999;
    }
    
    return _desL;
}



- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
